home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000824-20010305
/
000151_news@columbia.edu _Thu Dec 28 15:42:35 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-03-05
|
2KB
Return-Path: <news@columbia.edu>
Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
by monire.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id PAA22527
for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 28 Dec 2000 15:42:35 -0500 (EST)
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA01199
for <kermit.misc@watsun.cc.columbia.edu>; Thu, 28 Dec 2000 15:42:34 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id PAA28135
for kermit.misc@watsun.cc.columbia.edu; Thu, 28 Dec 2000 15:31:05 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
Message-ID: <3A4BA47C.53C64EBA@srv.net>
From: Kevin Handy <kth@srv.net>
Organization: Software Solutions, Inc
Subject: Re: A wish for the FTP-client
Date: Thu, 28 Dec 2000 13:37:16 -0700
To: kermit.misc@columbia.edu
Frank da Cruz wrote:
>
> In article <92g302$65t$1@localhost.localdomain>,
>
> I looked into this, and it would be easy enough to do, except for one
> thing: the lack of a critical API. When you send MDTM <filename> to
> the server, it sends back a string like this:
>
> 20001228143521
>
> representing 28 December 2000 14:35:21 (UTC/GMT). It is quite easy to
> convert this to a struct tm. But to change a file's date (with utime()
> or utimes()) requires a time_t, not a struct tm. How do you convert a
> struct tm to a time_t in a reliable way? -- i.e. without writing code to
> count days, months, years, leap years, leap seconds, and all the rest,
> taking each machine's architecture into account. I'm sure I must have
> overlooked something obvious -- feel free to embarrass me.
Under *nix, I believe the function to use is mktime
time_t mktime(struct tm *timeptr)